/**
 * Created by leezhenbo on 15/5/26.
 */
package screens {
import objects.Hero;

import starling.display.Sprite;
import starling.events.Event;

public class InGame extends Sprite{
    private var hero:Hero;
    public function InGame() {
        this.addEventListener(Event.ADDED_TO_STAGE,onAddedToStageHandler);
    }

    private function onAddedToStageHandler(event:Event):void{
        this.removeEventListener(Event.ADDED_TO_STAGE,onAddedToStageHandler)
        drawGame();
    }

    private function drawGame():void{
        hero = new Hero();
        hero.x = stage.stageWidth/2;
        hero.y = stage.stageHeight/2;
        this.addChild(hero);
    }

    public function initialize(){
        this.visible = true;
    }

    public function disposeTemporaily():void{
        this.visible = false;
    }

   }
}
